package response

type JsonResponse struct {
	ErrCode int         `json:"err_code"`
	ErrInfo string      `json:"err_info"`
	Data    interface{} `json:"data"`
}

func InternalServerError(err error) JsonResponse {
	return JsonResponse{
		ErrCode: 2,
		ErrInfo: err.Error(),
		Data:    "",
	}
}

var InvalidParameters = JsonResponse{
	ErrCode: 1,
	ErrInfo: "请求无效",
	Data:    "",
}
